package com.huatai.exchange.send;

import com.faneui.common.exception.BusinessException;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import java.util.Map;

@Service("fileFtpSendService")
public class FileFtpSendServiceImpl extends AbstractFileSendServiceImpl implements FileSendService {

    @Override
    public void sendMessage(String destAddress, Map<String, Object> resvMap) throws BusinessException {
        boolean b = resvMap.get("fileNames") == null || StringUtils.isBlank(resvMap.get("fileNames").toString());
        String fileNames = b ? null : resvMap.get("fileNames").toString();
        String filePaths = b ? null : resvMap.get("filePaths").toString();

        String businId = (String) resvMap.get("businId") ;

        communicationService.sendFTP(businId,destAddress, fileNames, filePaths);
    }
}
